//  水平 + 垂直 => 居中
@mixin centerAll(){
  display: flex;
  justify-content: center;
  align-items: center;
}

//文字不换行 wrap , ... 文字省略
@mixin noWrap() {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

//  文字强制换行
@mixin textWrap() {
  word-wrap: break-word;
  word-break: break-all;
}

// 扩展点击区域
@mixin extendClick() {
  position: relative;
  &:before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
  }
}


@mixin clearfix {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

@mixin tableScrollBar(){

  ::-webkit-scrollbar {
    width: 6px;
    height: 8px;
    background: rgba(144, 147, 153, .3);
  }

  ::-webkit-scrollbar-button:vertical {
    display: none;
  }

  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner {
    background-color: #e2e2e2;
  }

  ::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background-color: #a6a6a6;
  }

  ::-webkit-scrollbar-thumb:vertical:hover {
    background-color: #7f7f7f;
  }

  ::-webkit-scrollbar-thumb:vertical:active {
    background-color: rgba(0, 0, 0, .38);
  }

}

@mixin scrollBar($width: 6px) {
  &::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  &::-webkit-scrollbar {
    width: $width;
  }

  &::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }
}

@mixin relative {
  position: relative;
  width: 100%;
  height: 100%;
}

@mixin pct($pct) {
  width: #{$pct};
  position: relative;
  margin: 0 auto;
}

@mixin triangle($width, $height, $color, $direction) {
  $width: $width/2;
  $color-border-style: $height solid $color;
  $transparent-border-style: $width solid transparent;
  height: 0;
  width: 0;

  @if $direction==up {
    border-bottom: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==right {
    border-left: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }

  @else if $direction==down {
    border-top: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==left {
    border-right: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }
}
